﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using MySql.Data.MySqlClient;
using Cinemon;
using Cinemon.MySqlConnect;

/// <summary>
/// Summary description for AddService
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class AddService : System.Web.Services.WebService {

    public AddService () {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [WebMethod]
    public bool AddAttendee(int isle, int row, string name, int paid, int online, int cell, int discover, int showid, int amountPaid) {
        using (DatabaseManager manager = new DatabaseManager())
        {
            List<MySqlParameter> param = new List<MySqlParameter> {
				new MySqlParameter("islen", isle),
                new MySqlParameter("rown", row),
                new MySqlParameter("aname", name),
                new MySqlParameter("paid", paid),
                new MySqlParameter("online", online),
                new MySqlParameter("cell", cell),
                new MySqlParameter("discover", discover),
                new MySqlParameter("showid", showid),
                new MySqlParameter("amountPaid", amountPaid),
            };
            manager.ExecuteNonQuery("InsertAttendence", param);
        }
        return true;
    }
    
}
